home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / comm / cnet / sysopnote3.lha / sysopnote3 / Editor.rexx < prev    next >
OS/2 REXX Batch file  |  1997-03-15  |  9KB  |  161 lines

  1. /**************************************************************************\
  2.    $VER: Sysop Note 3 Editor V2.0 - © Copyright Bulldog Productions 1997 
  3. \**************************************************************************/
  4. options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR
  5. tr=transmit ; se=sendstring ; gc=getchar ; gu=getuser ; mg=maygetchar
  6. a='rexxsupport.library';if ~show('l',a) then if ~addlib(a,0,-30) then exit
  7.  
  8. xc.1= 4;yc.1 = 1;ml.1=0;mr.1=2;mu.1=0;md.1=3;but.1='c7z4<<Save & Exit       z0c7';bty.1=0
  9. xc.2= 4;yc.2 = 23;ml.2=1;mr.2=0;mu.2=0;md.2=3;but.2='c7z4<<Exit Without Save z0c7';bty.2=0
  10. xc.3= 6;yc.3 = 1;ml.3=0;mr.3=0;mu.3=1;md.3=4;but.3='c7z4Lowest Access Group  :z0c7 ';bty.3=2;ans.3='0';le.3='68 2'
  11. xc.4= 7;yc.4 = 1;ml.4=0;mr.4=0;mu.4=3;md.4=5;but.4='c7z4Highest Access Group :z0c7 ';bty.4=2;ans.4='31';le.4='68 2'
  12. xc.5= 8;yc.5 = 1;ml.5=0;mr.5=0;mu.5=4;md.5=6;but.5='c7z4Amount Of Bulletins  :z0c7 ';bty.5=2;ans.5='0' ;le.5='68 2'
  13. xc.6= 10;yc.6 = 1;ml.6=0;mr.6=16;mu.6=5;md.6=7;but.6='c7z4Title One    :z0c7 ';bty.6=2;ans.6='' ;le.6='4 25'
  14. xc.7= 11;yc.7 = 1;ml.7=0;mr.7=17;mu.7=6;md.7=8;but.7='c7z4Title Two    :z0c7 ';bty.7=2;ans.7='' ;le.7='4 25'
  15. xc.8= 12;yc.8 = 1;ml.8=0;mr.8=18;mu.8=7;md.8=9;but.8='c7z4Title Three  :z0c7 ';bty.8=2;ans.8='' ;le.8='4 25'
  16. xc.9= 13;yc.9 = 1;ml.9=0;mr.9=19;mu.9=8;md.9=10;but.9='c7z4Title Four   :z0c7 ';bty.9=2;ans.9='' ;le.9='4 25'
  17. xc.10= 14;yc.10 = 1;ml.10=0;mr.10=20;mu.10=9;md.10=11;but.10='c7z4Title Five   :z0c7 ';bty.10=2;ans.10='' ;le.10='4 25'
  18. xc.11= 15;yc.11 = 1;ml.11=0;mr.11=21;mu.11=10;md.11=12;but.11='c7z4Title Six    :z0c7 ';bty.11=2;ans.11='' ;le.11='4 25'
  19. xc.12= 16;yc.12 = 1;ml.12=0;mr.12=22;mu.12=11;md.12=13;but.12='c7z4Title Seven  :z0c7 ';bty.12=2;ans.12='' ;le.12='4 25'
  20. xc.13= 17;yc.13 = 1;ml.13=0;mr.13=23;mu.13=12;md.13=14;but.13='c7z4Title Eight  :z0c7 ';bty.13=2;ans.13='' ;le.13='4 25'
  21. xc.14= 18;yc.14 = 1;ml.14=0;mr.14=24;mu.14=13;md.14=15;but.14='c7z4Title Nine   :z0c7 ';bty.14=2;ans.14='' ;le.14='4 25'
  22. xc.15= 19;yc.15 = 1;ml.15=0;mr.15=25;mu.15=14;md.15=26;but.15='c7z4Title Ten    :z0c7 ';bty.15=2;ans.15='' ;le.15='4 25'
  23. xc.16= 10;yc.16 = 47;ml.16=6;mr.16=0;mu.16=5;md.16=17;but.16='c7z4Edit Posting 1 z0c7';bty.16=0
  24. xc.17= 11;yc.17 = 47;ml.17=7;mr.17=0;mu.17=16;md.17=18;but.17='c7z4Edit Posting 2 z0c7';bty.17=0
  25. xc.18= 12;yc.18 = 47;ml.18=8;mr.18=0;mu.18=17;md.18=19;but.18='c7z4Edit Posting 3 z0c7';bty.18=0
  26. xc.19= 13;yc.19 = 47;ml.19=9;mr.19=0;mu.19=18;md.19=20;but.19='c7z4Edit Posting 4 z0c7';bty.19=0
  27. xc.20= 14;yc.20 = 47;ml.20=10;mr.20=0;mu.20=19;md.20=21;but.20='c7z4Edit Posting 5 z0c7';bty.20=0
  28. xc.21= 15;yc.21 = 47;ml.21=11;mr.21=0;mu.21=20;md.21=22;but.21='c7z4Edit Posting 6 z0c7';bty.21=0
  29. xc.22= 16;yc.22 = 47;ml.22=12;mr.22=0;mu.22=21;md.22=23;but.22='c7z4Edit Posting 7 z0c7';bty.22=0
  30. xc.23= 17;yc.23 = 47;ml.23=13;mr.23=0;mu.23=22;md.23=24;but.23='c7z4Edit Posting 8 z0c7';bty.23=0
  31. xc.24= 18;yc.24 = 47;ml.24=14;mr.24=0;mu.24=23;md.24=25;but.24='c7z4Edit Posting 9 z0c7';bty.24=0
  32. xc.25= 19;yc.25 = 47;ml.25=15;mr.25=0;mu.25=24;md.25=26;but.25='c7z4Edit Posting 10z0c7';bty.25=0
  33. xc.51= 4;yc.51 = 1;ml.51=0;mr.51=52;mu.51=0;md.51=0;but.51='c7z4Lose Changesz0c7';bty.51=0
  34. xc.52= 4;yc.52 = 23;ml.52=51;mr.52=0;mu.52=0;md.52=0;but.52='c7z4Save Changesz0c7';bty.52=0
  35. nb=25    /* Number Of buttons */
  36. bn=1    /* Number Of First Button */
  37. bu=1    /* Button To Start On */
  38. if ~exists('pfiles:sysopnote3/details.data') then call DISBUT
  39. else
  40. do
  41. call open(details,'pfiles:sysopnote3/details.data','R')
  42. ans.3=readln(details);ans.4=readln(details);ans.5=readln(details);ans.6=readln(details)
  43. ans.7=readln(details);ans.8=readln(details);ans.9=readln(details);ans.10=readln(details)
  44. ans.11=readln(details);ans.12=readln(details);ans.13=readln(details);ans.14=readln(details)
  45. ans.15=readln(details);call close details;end
  46. call DISBUT
  47. do until exi=1 /* Main Loop */
  48.   key=CHECK(GETCURSOR());oldbu=bu;select
  49.     when key=8&mu.bu>0 then call MOVE(mu.bu)        /* Up     */
  50.     when key=2&md.bu>0 then call MOVE(md.bu)        /* Down   */
  51.     when key=4&ml.bu>0 then call MOVE(ml.bu)        /* Left   */
  52.     when key=6&mr.bu>0 then call MOVE(mr.bu)        /* Right  */
  53.     when key='!' then exit                          /* Panic Exit */
  54.     when key='0d'x then select                                                      /* Return */
  55.       when bty.bu=0 then interpret('Call BUTTON'bu) /* Action Button */
  56.       when bty.bu=1 then do                         /* Toggle Button */
  57.         ans.bu=ans.bu=0;transmit at(xc.bu,yc.bu+length(but.bu)-12)'c3'value('tog.'ans.bu);end
  58.       when bty.bu=2 then do                         /* String Button */
  59.         /* The 12 is the number of MCI codes in the Button string -1 */
  60.         transmit at(xc.bu,yc.bu+length(but.bu)-12)'c3L1305640 #'ans.bu'}I'le.bu'}'
  61.         getuser 70;ans.bu=result;end
  62.       when bty.bu=3 then do                         /* Cycle Button */
  63.         ans.bu=(ans.bu+1)*((ans.bu+1)<mc.bu);transmit at(xc.bu,yc.bu+length(but.bu)-12)'c3'value(cnm.bu'.'ans.bu);end
  64.         otherwise do;Transmit 'f1n1No button-type defined for button #'bu' - Exiting!';exit;end
  65.     end
  66.       otherwise nop
  67.   end
  68. end
  69. exit
  70.  
  71. /* CODE FOR EACH BUTTON */
  72.  
  73. BUTTON1:
  74. call open(details,'pfiles:sysopnote3/details.data','W')
  75. call writeln details,ans.3;call writeln details,ans.4;call writeln details,ans.5
  76. call writeln details,ans.6;call writeln details,ans.7;call writeln details,ans.8
  77. call writeln details,ans.9;call writeln details,ans.10;call writeln details,ans.11
  78. call writeln details,ans.12;call writeln details,ans.13;call writeln details,ans.14
  79. call writeln details,ans.15;call close details;tr 'f1Saving!!!';
  80. if ans.5='0' then address command 'delete pfiles:sysopnote3/details.data'
  81. exi=1;return
  82.  
  83. BUTTON2:
  84.   nb=2;  bn=51;  bu=51; call DISBUT;return
  85.  
  86. BUTTON16:
  87. WRITE:;CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/1';call DISBUT;return
  88.  
  89. BUTTON17:
  90. CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/2';call DISBUT;return
  91.  
  92. BUTTON18:
  93. CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/3';call DISBUT;return
  94.  
  95. BUTTON19:
  96. CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/4';call DISBUT;return
  97.  
  98. BUTTON20:
  99. CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/5';call DISBUT;return
  100.  
  101. BUTTON21:
  102. CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/6';call DISBUT;return
  103.  
  104. BUTTON22:
  105. CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/7';call DISBUT;return
  106.  
  107. BUTTON23:
  108. CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/8';call DISBUT;return
  109.  
  110. BUTTON24:
  111. CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/9';call DISBUT;return
  112.  
  113. BUTTON25:
  114. CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/10';call DISBUT;return
  115.  
  116. BUTTON51:
  117. exi=1;return
  118.  
  119. BUTTON52:
  120. call open(details,'pfiles:sysopnote3/details.data','W')
  121. call writeln details,ans.3;call writeln details,ans.4;call writeln details,ans.5
  122. call writeln details,ans.6;call writeln details,ans.7;call writeln details,ans.8
  123. call writeln details,ans.9;call writeln details,ans.10;call writeln details,ans.11
  124. call writeln details,ans.12;call writeln details,ans.13;call writeln details,ans.14
  125. call writeln details,ans.15;call close details;tr 'f1Saving!!!'
  126. if ans.5='0' then address command 'delete pfiles:sysopnote3/details.data'
  127. exi=1;return
  128.  
  129. DISBUT:;transmit 'f1>45}c4z7Sysop Note Version 3 Editor     z0n1>45}z7Use cursor keys; ENTER to selectz0c7'
  130.   oldbu=bu;do a=bn to nb+bn-1;sendstring at(xc.a,yc.a)but.a'c3'
  131.   select;when bty.a=1 then transmit value('tog.'ans.a);when bty.a=2 then transmit ans.a
  132.   when bty.a=3 then transmit value(cnm.a'.'ans.a);otherwise nop;end;end
  133.   /* The line below places "cursor" on the default button */
  134.   transmit at(xc.bu,yc.bu)'r1'but.bu'r0';return
  135. MOVE:;bu=arg(1);transmit at(xc.oldbu,yc.oldbu)but.oldbu||at(xc.bu,yc.bu)'r1'but.bu'r0';return
  136.  
  137. /* The following four routines are right from the CNet Amiga ToolKit! */
  138.  
  139. AT:;return ''arg(1)';'arg(2)'H'
  140.  
  141. GETCURSOR:
  142.   do until key~='NOCHAR';maygetchar;key=result;end
  143.   if key~='1B'x then return key;maygetchar;key=result
  144.   if key="[" then do;maygetchar;key=result;end
  145.   if key='A' then return '8';if key='B' then return '2'
  146.   if key='C' then return '6';if key='D' then return '4'
  147.  return key
  148.  
  149. CHECK:;if ARG()&ARG(1)~='###PANIC' then return ARG(1)
  150.   getcarrier;if result='TRUE' then if ARG() then return ARG(1);else return
  151.   logentry 'Lost Carrier in Sysop Note 3 Editor';bufferflush;exit
  152.  
  153. exit
  154. SYNTAX:;ERROR:;IOERR:;e1=' c9Errorcf: ca'rc' cf(ca'errortext(rc)'cf)'
  155. e2='  c9Linecf: ce'left(sigl,4)'c9Filecf:';gu 1311992;a=result
  156. gu 1311960;b=result;c='cb"ce'a||b'cb"';e2=e2' 'c;tr e1;tr e2;logentry e1
  157. logentry e2;e=sourceline(sigl);do while e~='';e3='c9Sourcecf: cd'
  158. e3=e3||left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush;exit
  159. /** Last Edited: 15-MAR-97 ************************************************\
  160. \************************************ Bad Obsession - +44-(0)1243-373596 **/
  161.